import sina
class DataSourceSohuImpl(sina.DataSourceSinaImpl):
    #def get_stock_quotation(self,stock_code_list,func=None,user_data=None):
	#	pass

	def get_img_to_file(self,stock_code,img_type,path,func=None,user_data=None):
	    code_map={'sh000001':'1A0001'}
	    code=code_map.get(stock_code,stock_code[2:])
	    type_map=\
	        {'min':'http://chart.stock.sohu.com/chart/bf/%s',
	        'daily':'http://image.stock.sohu.com/chart/chart/%s/day',
	         'weekly':'http://image.stock.sohu.com/chart/chart/%s/week',
	         'monthly':'http://image.stock.sohu.com/chart/chart/%s/month',
	         'macd':'http://image.stock.sohu.com/chart/chart/%s/macd',
	         'kdj':'http://image.stock.sohu.com/chart/chart/%s/kdj',
	         'wr':'http://image.stock.sohu.com/chart/chart/%s/wr',
	        }
	    mk=stock_code[0:2]
	    mk_map={'sh':'0','sz':'1'}
	    ty=type_map[img_type]
	    ty=ty % mk_map[mk]
	    url='%s/%s.png'  % (ty,code)
	    print url
	    DataSourceSohuImpl._get_url_to_file(self,url,path,func,user_data)
		#return DataSourceSinaImpl.get_img_to_file(self,stock_code,img_type,path,func,user_data)